package com.itheima.exception;

import com.itheima.common.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author 12441
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(NoLoginException.class)
    public R<String>NoLogException(NoLoginException ex){
        return R.error("No login......");
    }
    @ExceptionHandler(NoDateException.class)
    public R NoDateException(NoDateException ex){
        return R.error("No date......");
    }
//    @ExceptionHandler(Exception.class)
//    public R OtherException(Exception ex){
//        return R.error("系统繁忙......");
//    }

}
